from ultralytics import YOLO

# Load a model
# model = YOLO("/home/lixinlong/Project/yolo-train/yolo12m.yaml").load("/home/lixinlong/Project/yolo-train/output/minion_detect3/weights/best.pt")  # build a new model from YAML
model = YOLO("/home/lixinlong/Project/yolo-train/yolo12m.yaml")  # load a pretrained model (recommended for training)
# model = YOLO("yolo11n.yaml").load("yolo11n.pt")  # build from YAML and transfer weights

# Train the model
results = model.train(data="/home/lixinlong/Project/yolo-train/dataset.yaml", 
                      epochs=200, 
                      imgsz=640,
                      batch=16,
                      project="output",
                      name="belt_detect",
                      device="0")